package ueg.org.trabalho.util;


import java.awt.Component;
import javax.swing.JFormattedTextField;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextArea;
import javax.swing.JTextField;

public class Util {

    public static void LimpaTela(JPanel jpanel) throws Exception {
        for (Component c : jpanel.getComponents()) {
            if (c instanceof JTextField) {
                ((JTextField) c).setText(null);
            }
            if (c instanceof JFormattedTextField) {
                ((JFormattedTextField) c).setText(null);
            }
            if (c instanceof JTextArea) {
                ((JTextArea) c).setText(null);
            }
            if (c instanceof JRadioButton) {
                ((JRadioButton) c).setSelected(false);
            }
        }
    }
}